package top.surgeqi.security.demo.service;

import top.surgeqi.security.demo.bean.po.UserAccount;

/**
 * <p><em>Created by qipp on 2020/2/27 14:27</em></p>
 * 用户账户Service
 *
 * @author <a href="https://gitee.com/qipengpai">qipp</a>
 * @since 1.0.1
 */
public interface UserAccountService {

    /**
     * 根据用户名或手机号查询用户账户
     *
     * @param username 用户名或手机号
     * @return org.surge.oauth2common.model.UserAccount
     * @author qipp
     */
    UserAccount selectByUserName(String username);

    /**
     * 根据手机号查询用户账户
     *
     * @param phone 手机号
     * @return org.surge.oauth2common.model.UserAccount
     * @author qipp
     */
    UserAccount selectByPhone(String phone);

    /**
     * 组合用户账户对象与角色权限
     *
     * @param userAccount 用户账户对象
     * @return org.surge.oauth2common.model.UserAccount
     * @author qipp
     */
    UserAccount composeUserDetailsAndAuthority(UserAccount userAccount);

    /**
     * 根据微信unionId查询用户
     *
     * @param unionId 微信Id
     * @return org.surge.oauth2common.model.UserAccount
     * @author qipp
     */
    UserAccount selectWeChatUnionId(String unionId);
}
